package com.woody.aggregate.app.web.shop.es;

import com.woody.aggregate.application.service.shop.es.EsShopSyncService;
import com.woody.aggregate.infrastructure.shop.es.esdoc.ShopInfo;
import com.woody.aggregate.shop.req.es.EsShopSyncRequest;
import com.woody.base.model.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.dromara.easyes.core.biz.SAPageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * &copy; All rights Reserved
 *
 * @author wénkǎi.zhāng 2025-04-07
 */
@RestController
@RequestMapping("es/shopSync")
@Api(tags = "门店数据同步ES相关接口")
public class EsShopSyncController {

    @Autowired
    private EsShopSyncService esShopSyncService;

    @PostMapping("/shopInfoSync")
    @ApiOperation("同步门店信息")
    public Response<Void> syncShopInfo(@RequestBody @Valid EsShopSyncRequest request) {
        esShopSyncService.syncShopInfo(request.getShopIds());
        return Response.success();
    }

}
